<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
<style>
       table{
        margin: auto;
        border-collapse:collapse;
       }
        tr, th{border: 1px solid ;
            padding: 4px;
       }
        tr,td{border: 1px solid ;
            padding: 4px;
        }
    </style>
</head>
<body>
  <script>
    let card = prompt('请输入银行卡总额')
    let shui = +prompt('请输入水费')
    let dian = +prompt('请输入电费')
    let wang = prompt('请输入网费')
    let yu = card - shui - dian - wang 
    document.write
    (`
    <table>
    <caption>  <h2>2020年12月消费支出</h2></caption>
    <tr>
      <th>周澎的银行卡总额</th>
      <th>水费</th>
      <th>电费</th>
      <th>网费</th>
      <th>周澎的余额</th>
    </tr>
    <tr>
      <td>${card}</td>
      <td>${shui}</td>
      <td>${dian}</td>
      <td>${wang}</td>
      <td>${yu}</td>
    </tr>
  </table>
    `)
  </script>
</body>
</html>
